package com.ehotting.edsta.circuitDesign.gen.element.enums;

public enum ConditionTypeEnum {

    IF(0,"if","如果"),
    ELSE_IF(1,"else if","否则如果"),
    ELSE(3,"else","否则");


    private Integer value;
    private String script;
    private String name;

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getScript() {
        return script;
    }

    public void setScript(String script) {
        this.script = script;
    }

    ConditionTypeEnum(Integer value, String script, String name) {
        this.value = value;
        this.script = script;
        this.name = name;
    }


    public static ConditionTypeEnum getObject(Integer value){
        ConditionTypeEnum[] rules = ConditionTypeEnum.values();
        for(ConditionTypeEnum rule : rules){
            if(rule.getValue().equals(value)){
                return rule;
            }
        }
        return ConditionTypeEnum.ELSE;
    }

}
